home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip1292.zip / NOCTRLC.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  1KB  |  38 lines

  1. /****************************************************************/
  2. /* Name: noctrl()                                               */
  3. /* Desc: captures interrput 9 so as to ignore ctrl-c,ctrl-break,*/
  4. /*       ctrl-alt-del                                           */
  5. /****************************************************************/
  6.  
  7. void interrupt noctrl(void)
  8. {
  9.       char byte;
  10.       static int flag;
  11.       extern void interrupt (*oldint9)(void);
  12.  
  13.       enable();
  14.  
  15.       if ((byte = inportb(0x60)) == 29)
  16.             flag = 1;
  17.  
  18.       if (byte == 157)
  19.             flag = 0;
  20.  
  21.       if (!flag)
  22.             (*oldint9)();
  23.       else  switch (byte)
  24.       {
  25.       case 46 :   /* yeah, these should be #defined! */
  26.       case 70 :
  27.       case 56 :
  28.       case 83 :
  29.             byte = inportb(0x61);
  30.             outportb(0x61,byte | 0x80);
  31.             outportb(0x61,byte);
  32.             outportb(0x20,0x20);
  33.             break;
  34.       default :
  35.             (*oldint9)();
  36.       }
  37. }
  38.